Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      ],
     list2: [
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
      {name:'joke',gender:'男'},
      {name:'rose',gender:'女'},
    ],
    show:'none',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  inpshow: function () {
    this.setData({
      show : 'block'
    })
  },
  // 获取性别选择
  goodprice: function(e) {
    var arr = [];
    var that =this;
    let list2 = that.data.list2;
      that.setData({
        list: list2,  
      }) 
    if (e.detail.value == '男') {
      for (let index = 0; index < this.data.list.length; index++) {
        if(this.data.list[index].gender == '男') {
          arr.push(this.data.list[index]);
        }        
      }
      this.setData({
        list : arr,
        show:'none'
      })
     
    }else if (e.detail.value == '女') {
      for (let index = 0; index < this.data.list.length; index++) {
        if(this.data.list[index].gender == '女') {
          arr.push(this.data.list[index]);
        }        
      }
      this.setData({
        list : arr,
        show:'none'
      })
    }
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    var that =this;
    let list2 = that.data.list2;
      that.setData({
        list: list2,  
      }) 
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    var that =this;
    let list = that.data.list;
    let list2 = that.data.list2;
    list=[...list,...list2];
      that.setData({
        list: list,  
      }) 
  },

})